package bean;

import java.util.ArrayList;

import util.ClientPage;

public class OrdersBean {
	ClientPage p = new ClientPage();

	private String sql = "";
	private int count = 0;
	private int sumPage = 0;
	private ArrayList info = null;
	private String condition = "";
	

	public void getInfo(String showRow){
		sql = "select count(*) as count from feiji";
		count = p.getCount(sql);
		sumPage = p.getSumPage(count,Integer.parseInt(showRow));
	}
	
	public void getInfoCondition(String showRow){
		sql = "select count(*) as count from feiji where "+condition;
		count = p.getCount(sql);
		sumPage = p.getSumPage(count,Integer.parseInt(showRow));
	}
	
	public void getInfoYuding(String showRow){
		sql = "select count(*) as count from yudingji";
		count = p.getCount(sql);
		sumPage = p.getSumPage(count,Integer.parseInt(showRow));
	}
	/**
	 * ��ȡ��ǰҳ����Ϣ
	 * @param page
	 * @return
	 */
	public ArrayList getInfo(int page,String showRow){
		String args[] = {"id","banci","gongsi","qifeichengshi","qifeijichang","qifeitime","daodachengshi","daodajichang","daodatime","distance","jingji","jingjisums","toudeng","toudengsums","beizhu"};
		info = p.getPage(page,Integer.parseInt(showRow),args);
		return info;
	}
	public ArrayList getInfoCondition(int page,String showRow){
		String args[] = {"id","banci","gongsi","qifeichengshi","qifeijichang","qifeitime","daodachengshi","daodajichang","daodatime","distance","jingji","jingjisums","toudeng","toudengsums","beizhu"};
		info = p.getPage(page,Integer.parseInt(showRow),args,condition);
		return info;
	}
	public ArrayList getInfoYuding(int page,String showRow){
		String args[] = {"id","usersid","feijiid","zuoxi","price","sums","zongjia","times","zhifu"};
		info = p.getPageYuding(page,Integer.parseInt(showRow),args);
		return info;
	}
	/**
	 * ����������
	 * @return
	 */
	public int getCount(){
		return count;
	}
	/**
	 * ������ҳ��
	 * @return
	 */
	public int getSumPage(){
		return sumPage;
	}
	
	public String getCondition(){
		return condition;
	}
	
	public void setCondition(String condition){
		this.condition = condition;
	}
}
